import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("shopper")
class Shopper extends BaseService {
	page({ size, ...args }) {
		let params = {
			...args,
			limit: size
		};
		return this.$get("/groupBookingLists", { params })
			.then(res => {
				return {
					list: res?.lists?.data ?? [],
					pagination: {
						...params,
						size,
						total: res?.lists?.total ?? 0
					}
				};
			})
			.catch(() => {});
	}
	add(params) {
		return this.$post("/addGroupBooking", params, {
			silence: true
		});
	}
	edit(params) {
		return this.$post("/editGroupBooking", params, {
			silence: true
		});
	}
	del(params) {
		return this.$get(
			"/delGroupBooking",
			{ params },
			{
				silence: true
			}
		);
	}
	info(params) {
		return this.$get(
			"/groupBookingSingle",
			{ params },
			{
				silence: true
			}
		);
	}
	getStatus(params) {
		return this.$post("/groupBookingStatus", params, {
			silence: true
		});
	}
}
export default Shopper;
